#ifndef TMENUITEM_H
#define TMENUITEM_H
#include <QString>
#include <QPushButton>
#include <QHBoxLayout>
#include <QProcess>
#include <QPointer>
#include "tformmenuitem.h"
#include <errors.h>
#include <QWebView>

class TMenuItem: public TFormMenuItem {
    Q_OBJECT
public:
    TMenuItem(const QString&,const QString&_execName=QString(""), bool _openNextWindow = false, const QStringList&_tops=QStringList());
    ~TMenuItem();
    void setName(const QString &newName);
    QString getName();
    //void setHelp(const QString &newName);
    QString getHelp();
    void setId(const quint16);
    quint16 getId();
    void setFile(const QString &);
    void setExecName(const QString &);
    void setTops(const QStringList&);
    QString getExecName();
    bool isOpenNextWindow();
    void setOpenNextWindow(bool);
private slots:
    void exec();
    void help_slot();
    void remove_slot();
    void edit_slot();
signals:
    void s_edit(TMenuItem *);
    void s_delete(TMenuItem *);
    void s_open_new_window(const quint16 id, const QStringList&, const QString&);
protected:
    QString file;
private:
    quint16 id;
    QStringList tops;
    QProcess proc;
    QString exeName;
    QString helpName;
    bool openNextWindow;
    QWebView *wv;
};

#endif // TMENUITEM_H
